import request from '@/utils/request'
// 获取角色列表
export const getRoleList = ({ page, pagesize }) => {
  return request.get('/sys/role', {
    params: {
      page,
      pagesize
    }
  })
}
// 添加角色
export const addRole = (data) => {
  return request.post('/sys/role', data)
}
// 编辑角色
export const updateRole = (data) => {
  return request.put(`/sys/role/${data.id}`, data)
}
// 删除角色
export const delRole = (id) => {
  return request.delete(`/sys/role/${id}`)
}

// 分配角色权限
export const getOpenList = (data) => {
  return request.put('/sys/role/assignPrem', data)
}
// 获取角色
export const getRoleDetail = (id) => {
  return request.get(`/sys/role/${id}`)
}
